﻿<#include "/common/h-ui-base-css.html">
<#include "/common/h-ui-base-js.html">
<#include "/common/validation-js.html">

<link href="/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />

<!--请在下方写此页面业务相关的脚本-->
<#--<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>-->
<script type="text/javascript" src="/lib/webuploader/0.1.5/webuploader.min.js"></script>
<body>
<div class="page-container">
	<form class="form form-horizontal" id="form-global-set">
		<div id="tab-system" class="HuiTab">
			<div class="tabBar cl">
				<span>基本设置</span>
			</div>
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">
						<span class="c-red">*</span>
						网站名称：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="globalNetName" name="globalNetName" value="${entity.globalNetName!}" placeholder="控制在25个字、50个字节以内" class="input-text">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">
						<span class="c-red">*</span>
						底部版权信息：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="globalCopyright" name="globalCopyright"  placeholder="&copy; 2016 H-ui.net" value="${entity.globalCopyright!}" class="input-text">
					</div>
				</div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>网站简称：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" id="globalShortNetName" name="globalShortNetName" placeholder="网站简称" value="${entity.globalShortNetName!}" class="input-text">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">首页背景图片：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <span class="l"><a class="btn btn-primary radius" id="btn-star"><i class="Hui-iconfont">&#xe600;</i> 添加背景图片</a></span>
                    </div>
                </div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">备案号：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="globalICP" name="globalICP" placeholder="京ICP备00000000号" value="${entity.globalICP!}" class="input-text">
					</div>
				</div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">允许访问后台的IP列表：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <textarea class="textarea" name="globalPermitIPs" id="globalPermitIPs" value="${entity.globalPermitIPs!}"></textarea>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">后台登录失败最大次数：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" value="5" id="" name="" >
                    </div>
                </div>
			</div>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
				<button class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>



<script type="text/javascript">
	$(function(){
		$('.skin-minimal input').iCheck({
			checkboxClass: 'icheckbox-blue',
			radioClass: 'iradio-blue',
			increaseArea: '20%'
		});
		$("#tab-system").Huitab({
			index:0
		});
		$('#btn-star').click(function () {
            var url = '/uploadSolution';
            var index = layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                area: ['720px', '481px'], //宽高
                content: url
            });
        });
        $("#form-global-set").validate({
            rules:{
                globalNetName:{
                    required:true,
                    minlength:2,
                    maxlength:16
                },
                globalCopyright:{
                    required:true,
                    minlength:1,
                    maxlength:16
                },
                globalShortNetName:{
                    required:true,
                    minlength:1,
                    maxlength:16
                }
            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type: 'post',
                    url: "/global-save" ,
                    data :$("form-global-set").serialize(),
                    async:false,
                    success: function(data){
                        layer.msg('添加成功!',{icon:1,time:1000});
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg('error!',{icon:1,time:1000});
                    }
                });
                // var index = parent.layer.getFrameIndex(window.name);
                // parent.$('#column_table').datagrid('reload');
                // parent.layer.close(index);
            }
        });
	});
</script>

<script type="text/javascript">

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
